﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmLista_Cliente.aspx.cs" Inherits="WebExportaciones.frmLista_Cliente" %>

<!DOCTYPE html>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <title>Mantenimiento de Cliente</title>
   <script type="text/javascript">
       function VerMantenimiento(modo, dato) {
           var RetornoAnterior = window.returnValue;
           window.returnValue = undefined;
           var rpta = window.showModalDialog("frmMant_Cliente.aspx?modo=" + modo + "&Id=" + dato, "", "dialogWidth:1040px;dialogHeight:700px;dialogCenter:1;resizable:no");
           if (rpta == undefined) {
               rpta = window.returnValue;
           }
           window.returnValue = RetornoAnterior;

           if (rpta == '1') {
               document.getElementById("btnBuscar").click();
           }
       }
   </script>
</head>
<body>
   <form id="_frmLista_Cliente" runat="server">
      <div>
         <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
               <table style="width:100%;">
                  <tr>
                     <td>
                        <h2 style="text-align: center">Listado de tabla Cliente</h2>
                     </td>
                  </tr>
                  <tr>
                     <td>
                        <table style="width:100%">
                           <tr>
                              <td>
                                 <table style="border: 1px solid #AAAAAA; width: 100%; height: 40px; border-spacing: 0px; width:100%">
                                    <tr style="border-style: none; background-color: #EEEEEE; border-width: 0px;">
                                       <td style="border-style: none; margin-left:2px; margin-right:2px; width:160px;">
                                          &nbsp;dCliente
                                       </td>
                                       <td style="border-style: none; width: 70%;">
                                          <asp:TextBox ID="txtFiltro" runat="server" Width="80%" OnTextChanged="AccionBuscar" ClientIDMode="Static"></asp:TextBox>
                                       </td>
                                       <td style="text-align: center;  border-width: 0px; border-spacing: inherit;" class="auto-style1">
                                          <asp:Button ID="btnBuscar" runat="server" Text="Buscar" CssClass="boton" OnClick="AccionBuscar" ClientIDMode="Static" />
                                       </td>
                                    </tr>
                                 </table>
                                 <table style="width: 100%; height: 50px;">
                                    <tr>
                                       <td style="width: 50%; text-align: center;">
                                          <asp:Button ID="btnNuevo" runat="server" Text="Nuevo" CssClass="boton" OnClick="AccionNuevo" ClientIDMode="Static"  />
                                       </td>
                                       <td style="width: 50%; text-align: center;">
                                          <asp:Button ID="btnEliminar" runat="server" Text="Eliminar" CssClass="boton" OnClick="AccionEliminar" Enabled="False" ClientIDMode="Static" />
                                       </td>
                                    </tr>
                                 </table>
                              </td>
                           </tr>
                           <tr style="height:310px; background-color:#EEEEEE; vertical-align:top; border:solid;">
                              <td>
                                 <asp:GridView ID="gvCliente" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                                       BackColor="#EEEEEE" BorderColor="#AAAAAA" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2"
                                       EnableViewState="False" onpageindexchanging="Paginar"
                                       Width="100%"  OnRowCommand="gvCliente_RowCommand">
                                    <AlternatingRowStyle BackColor="#EEEEEE" />
                                    <Columns>
                                       <asp:TemplateField>
                                          <ItemStyle HorizontalAlign ="Center" Width="20px" />
                                          <ItemTemplate>
                                             <asp:CheckBox ID="chkSeleciona" runat="server" CommandArgument="<%#Container.DataItemIndex%>" />
                                          </ItemTemplate>
                                       </asp:TemplateField>
                                       <asp:BoundField DataField="idCliente" HeaderText="idCliente" SortExpression="idCliente">
                                          <HeaderStyle Wrap="False" />
                                          <ItemStyle HorizontalAlign ="Right" Wrap="False" />
                                       </asp:BoundField>
                                       <asp:BoundField DataField="sodigo" HeaderText="sodigo" SortExpression="sodigo">
                                          <HeaderStyle Wrap="False" />
                                          <ItemStyle HorizontalAlign ="Right" Wrap="False" />
                                       </asp:BoundField>
                                       <asp:BoundField DataField="srazonSocial" HeaderText="srazonSocial" SortExpression="srazonSocial">
                                          <HeaderStyle Wrap="False" />
                                          <ItemStyle HorizontalAlign ="Right" Wrap="False" />
                                       </asp:BoundField>
                                       <asp:BoundField DataField="sruc" HeaderText="sruc" SortExpression="sruc">
                                          <HeaderStyle Wrap="False" />
                                          <ItemStyle HorizontalAlign ="Right" Wrap="False" />
                                       </asp:BoundField>
                                       <asp:ButtonField ButtonType="Image" runat="server" HeaderText="Modificar" CommandName="Select" ImageUrl="Imagenes/imgBuscar.png" Text="Modificar" ControlStyle-Width="16px" ItemStyle-Width="20px" >
                                       <ControlStyle Width="16px" />
                                       <ItemStyle Width="20px" />
                                       </asp:ButtonField>
                                    </Columns>
                                    <HeaderStyle BackColor="#AAAAAA" Font-Bold="True" ForeColor="Black" />
                                    <PagerSettings Visible="False" />
                                    <RowStyle BackColor="White" ForeColor="#000000" />
                                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                                    <SortedAscendingCellStyle BackColor="#FFF1D4" />
                                    <SortedAscendingHeaderStyle BackColor="#B95C30" />
                                    <SortedDescendingCellStyle BackColor="#F1E5CE" />
                                    <SortedDescendingHeaderStyle BackColor="#93451F" />
                                 </asp:GridView>
                              </td>
                           </tr>
                           <tr>
                              <td>
                                 <table style="width:100%;">
                                    <tr>
                                       <td style="color: #FF6600">
                                          &nbsp;P&aacute;gina&nbsp;<asp:TextBox ID="txtPagina" runat="server" Width="50px" OnTextChanged="EventoTecladoTxtPagina" ClientIDMode="Static"></asp:TextBox> de <asp:Label ID="lblTotalPaginas" runat="server" Text="0"  ClientIDMode="Static"></asp:Label>
                                       </td>
                                       <td style="text-align: center;">
                                          <asp:Button ID="btnPrimero" runat="server" OnClick="Paginar" Text="Primero" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="-2" />&nbsp;
                                          <asp:Button ID="btnPrevio" runat="server" OnClick="Paginar" Text="Previo" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="-1"/>&nbsp;
                                          <asp:Button ID="btnPagina1" runat="server" OnClick="Paginar" Text="1" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="1"/>&nbsp;
                                          <asp:Button ID="btnPagina2" runat="server" OnClick="Paginar" Text="2" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="2"/>&nbsp;
                                          <asp:Button ID="btnPagina3" runat="server" OnClick="Paginar" Text="3" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="3"/>&nbsp;
                                          <asp:Button ID="btnPagina4" runat="server" OnClick="Paginar" Text="4" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="4"/>&nbsp;
                                          <asp:Button ID="btnPagina5" runat="server" OnClick="Paginar" Text="5" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="5"/>&nbsp;
                                          <asp:Button ID="btnSiguiente" runat="server" OnClick="Paginar" Text="Siguiente" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="+1"/>&nbsp;
                                          <asp:Button ID="btnUltimo" runat="server" OnClick="Paginar" Text="Ultimo" BackColor="White" BorderColor="#FF6600" BorderStyle="Solid" ForeColor="#FF6600" CommandArgument="+2"/>
                                          <asp:HiddenField ID="hdfPaginaActual" runat="server"  ClientIDMode="Static" />
                                          <asp:HiddenField ID="hdfModoMantenimiento" runat="server" ClientIDMode="Static" />
                                          <asp:HiddenField ID="hdfParametroID" runat="server" ClientIDMode="Static" />
                                       </td>
                                       <td style="text-align: right; margin-right: 10px; color: #FF6600">
                                          Total de registros: <asp:Label ID="lblTotalRegistros" runat="server" Text="0"></asp:Label>&nbsp;
                                       </td>
                                    </tr>
                                 </table>
                              </td>
                           </tr>
                        </table>
                     </td>
                  </tr>
                  <tr style="height:5px; font-size:x-small;">
                     <td></td>
                  </tr>
                  <tr>
                     <td>
                        <table style="background-color: #FFCCCC; border: 1px solid #FF9999; color: #FF0000; width:100%" >
                           <tr>
                              <td style="text-align: center">
                                 <asp:Label ID="lblMensajeError" runat="server" Text=""></asp:Label>
                              </td>
                           </tr>
                        </table>
                     </td>
                  </tr>
                  <tr style="height:5px; font-size:x-small;">
                     <td></td>
                  </tr>
               </table>
            </ContentTemplate>
            <Triggers>
               <asp:AsyncPostBackTrigger ControlID="gvCliente" EventName="SelectedIndexChanged">
               </asp:AsyncPostBackTrigger>
            </Triggers>
         </asp:UpdatePanel>
      </div>
   </form>
</body>
</html>
